<?php

namespace View;

require_once ('View/NavigationView.php');

class UserView {
	
	//Returnerar lista med filmer	
	public function showMovies(\Model\MovieArray $movieArray) {
			
		$ret="";
	    $ret .= "<div id=movielist>";
        $ret .= "<h2>my movies</h2>";
        $ret .= "<ul>";
        foreach ($movieArray->get() as $movie) {
        	$movieLink = NavigationView::getMovieLink($movie);
			$ret .= "<li><a href='$movieLink'>" . $movie->getName() . "</a></li>";
              
        }
        $ret .= "</ul>";
        $ret .= "</div>";
        return $ret;
     }
	 
	//Returnerar detaljerad information för vald film
	public function showMovie($movie){
		
		$title = $movie->getName();
		$review = $movie->getReview();
		$rating = $movie->getRating();
		$image = $movie->getImage();
			
		return "
				<div id='movie'>
					<p> Title: $title </p>
					<p> Review: $review </p>
					<p> Rating: $rating </p> 
					<img src='images/$image'width='200'/>
				</div>	
		";
	}
	 //Returnerar användarnamnet	
	 public function showUser($user) {
	 	
		$username = $user->getUsername();
	 	
		return "<div id='user'>
					<h2>$username</h2>
				</div>";
	 	
	 }
	 
	 public function showDescription(){
	 	return '<div id=description>
	 	<p> In the movie feed you can see your friends movies, and when you add a movie to your page 
	 	your frinds will see it in their movie feed. If your friends have not added any movies movie feed will 
	 	be empty</p>
	 	</div>
	 	';
	 }
		 
}
